package com.neteast.androidclient.newscenter;

import com.neteast.androidclient.newscenter.activity.MainActivity;
import com.neteast.androidclient.newscenter.service.WidgetService;
import android.app.Application;
import android.content.Context;
import android.graphics.Point;
import android.util.DisplayMetrics;
import android.view.WindowManager;
/**
 * 本类代表消息盒子应用本身。
 * @author tiangh
 *
 */
public class NewsCenter extends Application {
	
	
	public WidgetService widgetService;
	public MainActivity mainActivity;
	
	
	public Point basePoint;
	
	private WindowManager wm;

	public float screenDensity;
	public int screenWidth;
	public int screenHeight;

	
	@Override
	public void onCreate() {
		super.onCreate();
		wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
		DisplayMetrics metrics=new DisplayMetrics();
		wm.getDefaultDisplay().getMetrics(metrics);
		screenHeight = metrics.heightPixels;
		screenWidth = metrics.widthPixels;
		screenDensity = metrics.density;
		initBasePoint();
	}
	
	
	private void initBasePoint() {
		int height = -screenHeight/2;
		int width = -screenWidth/2;
		basePoint=new Point(width, height);
	}
}
